#pragma once
#include <iostream>
#include "IStrategy.h"

// 一个base class可以将抽象方法的实现变成可选的，派生类只需要选择实现自己想要的方法。
// 日后若有新的 event class添加，可以在base class和部分派生类中实现对新event class方法，
// 不必修改所有IStrategy的实现class.
class StrategyBase : public IStrategy
{
	virtual void OnEvent(const EventTick& event) override
	{

	}
	virtual void OnEvent(const EventOrder& event) override
	{

	}
	virtual void OnEvent(const EventTrade& event) override
	{

	}
	virtual void OnEvent(const EventPosition& event) override
	{

	}
};

class StrategyA : public StrategyBase
{
public:
	virtual void OnEvent(const EventTick& event) override
	{
		std::cout << "StrategyA handle tick event" << std::endl;
	}
	virtual void OnEvent(const EventOrder& event) override
	{
		std::cout << "StrategyA handle order event" << std::endl;
	}
	virtual void OnEvent(const EventTrade& event) override
	{
		std::cout << "StrategyA handle trade event" << std::endl;
	}
	virtual void OnEvent(const EventPosition& event) override
	{
		std::cout << "StrategyA handle position event" << std::endl;
	}
};

class StrategyB : public StrategyBase
{
public:
	virtual void OnEvent(const EventTick& event) override
	{
		std::cout << "StrategyB handle tick event" << std::endl;
	}
	virtual void OnEvent(const EventOrder& event) override
	{
		std::cout << "StrategyB handle order event" << std::endl;
	}

	//不实现其他的IStrategy方法
};